{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _classCallCheck from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";\nimport _createClass from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/createClass.js\";\nimport _createForOfIteratorHelper from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = function __defNormalProp(obj, key, value) {\n  return key in obj ? __defProp(obj, key, {\n    enumerable: true,\n    configurable: true,\n    writable: true,\n    value: value\n  }) : obj[key] = value;\n};\nvar __spreadValues = function __spreadValues(a, b) {\n  for (var prop in b || (b = {})) {\n    if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);\n  }\n  if (__getOwnPropSymbols) {\n    var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),\n      _step;\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var prop = _step.value;\n        if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n  }\n  return a;\n};\nvar __objRest = function __objRest(source, exclude) {\n  var target = {};\n  for (var prop in source) {\n    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];\n  }\n  if (source != null && __getOwnPropSymbols) {\n    var _iterator2 = _createForOfIteratorHelper(__getOwnPropSymbols(source)),\n      _step2;\n    try {\n      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n        var prop = _step2.value;\n        if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop];\n      }\n    } catch (err) {\n      _iterator2.e(err);\n    } finally {\n      _iterator2.f();\n    }\n  }\n  return target;\n};\n\n// src/index.tsx\nimport React, { useRef, useEffect, useState } from \"react\";\n\n// src/third-party/qrcodegen/index.ts\n/**\n * @license QR Code generator library (TypeScript)\n * Copyright (c) Project Nayuki.\n * SPDX-License-Identifier: MIT\n */\nvar qrcodegen;\n(function (qrcodegen2) {\n  var _QrCode = /*#__PURE__*/function () {\n    function _QrCode(version, errorCorrectionLevel, dataCodewords, msk) {\n      _classCallCheck(this, _QrCode);\n      this.version = version;\n      this.errorCorrectionLevel = errorCorrectionLevel;\n      this.modules = [];\n      this.isFunction = [];\n      if (version < _QrCode.MIN_VERSION || version > _QrCode.MAX_VERSION) throw new RangeError(\"Version value out of range\");\n      if (msk < -1 || msk > 7) throw new RangeError(\"Mask value out of range\");\n      this.size = version * 4 + 17;\n      var row = [];\n      for (var i = 0; i < this.size; i++) {\n        row.push(false);\n      }\n      for (var _i = 0; _i < this.size; _i++) {\n        this.modules.push(row.slice());\n        this.isFunction.push(row.slice());\n      }\n      this.drawFunctionPatterns();\n      var allCodewords = this.addEccAndInterleave(dataCodewords);\n      this.drawCodewords(allCodewords);\n      if (msk == -1) {\n        var minPenalty = 1e9;\n        for (var _i2 = 0; _i2 < 8; _i2++) {\n          this.applyMask(_i2);\n          this.drawFormatBits(_i2);\n          var penalty = this.getPenaltyScore();\n          if (penalty < minPenalty) {\n            msk = _i2;\n            minPenalty = penalty;\n          }\n          this.applyMask(_i2);\n        }\n      }\n      assert(0 <= msk && msk <= 7);\n      this.mask = msk;\n      this.applyMask(msk);\n      this.drawFormatBits(msk);\n      this.isFunction = [];\n    }\n    _createClass(_QrCode, [{\n      key: \"getModule\",\n      value: function getModule(x, y) {\n        return 0 <= x && x < this.size && 0 <= y && y < this.size && this.modules[y][x];\n      }\n    }, {\n      key: \"getModules\",\n      value: function getModules() {\n        return this.modules;\n      }\n    }, {\n      key: \"drawFunctionPatterns\",\n      value: function drawFunctionPatterns() {\n        for (var i = 0; i < this.size; i++) {\n          this.setFunctionModule(6, i, i % 2 == 0);\n          this.setFunctionModule(i, 6, i % 2 == 0);\n        }\n        this.drawFinderPattern(3, 3);\n        this.drawFinderPattern(this.size - 4, 3);\n        this.drawFinderPattern(3, this.size - 4);\n        var alignPatPos = this.getAlignmentPatternPositions();\n        var numAlign = alignPatPos.length;\n        for (var _i3 = 0; _i3 < numAlign; _i3++) {\n          for (var j = 0; j < numAlign; j++) {\n            if (!(_i3 == 0 && j == 0 || _i3 == 0 && j == numAlign - 1 || _i3 == numAlign - 1 && j == 0)) this.drawAlignmentPattern(alignPatPos[_i3], alignPatPos[j]);\n          }\n        }\n        this.drawFormatBits(0);\n        this.drawVersion();\n      }\n    }, {\n      key: \"drawFormatBits\",\n      value: function drawFormatBits(mask) {\n        var data = this.errorCorrectionLevel.formatBits << 3 | mask;\n        var rem = data;\n        for (var i = 0; i < 10; i++) {\n          rem = rem << 1 ^ (rem >>> 9) * 1335;\n        }\n        var bits = (data << 10 | rem) ^ 21522;\n        assert(bits >>> 15 == 0);\n        for (var _i4 = 0; _i4 <= 5; _i4++) {\n          this.setFunctionModule(8, _i4, getBit(bits, _i4));\n        }\n        this.setFunctionModule(8, 7, getBit(bits, 6));\n        this.setFunctionModule(8, 8, getBit(bits, 7));\n        this.setFunctionModule(7, 8, getBit(bits, 8));\n        for (var _i5 = 9; _i5 < 15; _i5++) {\n          this.setFunctionModule(14 - _i5, 8, getBit(bits, _i5));\n        }\n        for (var _i6 = 0; _i6 < 8; _i6++) {\n          this.setFunctionModule(this.size - 1 - _i6, 8, getBit(bits, _i6));\n        }\n        for (var _i7 = 8; _i7 < 15; _i7++) {\n          this.setFunctionModule(8, this.size - 15 + _i7, getBit(bits, _i7));\n        }\n        this.setFunctionModule(8, this.size - 8, true);\n      }\n    }, {\n      key: \"drawVersion\",\n      value: function drawVersion() {\n        if (this.version < 7) return;\n        var rem = this.version;\n        for (var i = 0; i < 12; i++) {\n          rem = rem << 1 ^ (rem >>> 11) * 7973;\n        }\n        var bits = this.version << 12 | rem;\n        assert(bits >>> 18 == 0);\n        for (var _i8 = 0; _i8 < 18; _i8++) {\n          var color = getBit(bits, _i8);\n          var a = this.size - 11 + _i8 % 3;\n          var b = Math.floor(_i8 / 3);\n          this.setFunctionModule(a, b, color);\n          this.setFunctionModule(b, a, color);\n        }\n      }\n    }, {\n      key: \"drawFinderPattern\",\n      value: function drawFinderPattern(x, y) {\n        for (var dy = -4; dy <= 4; dy++) {\n          for (var dx = -4; dx <= 4; dx++) {\n            var dist = Math.max(Math.abs(dx), Math.abs(dy));\n            var xx = x + dx;\n            var yy = y + dy;\n            if (0 <= xx && xx < this.size && 0 <= yy && yy < this.size) this.setFunctionModule(xx, yy, dist != 2 && dist != 4);\n          }\n        }\n      }\n    }, {\n      key: \"drawAlignmentPattern\",\n      value: function drawAlignmentPattern(x, y) {\n        for (var dy = -2; dy <= 2; dy++) {\n          for (var dx = -2; dx <= 2; dx++) {\n            this.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);\n          }\n        }\n      }\n    }, {\n      key: \"setFunctionModule\",\n      value: function setFunctionModule(x, y, isDark) {\n        this.modules[y][x] = isDark;\n        this.isFunction[y][x] = true;\n      }\n    }, {\n      key: \"addEccAndInterleave\",\n      value: function addEccAndInterleave(data) {\n        var ver = this.version;\n        var ecl = this.errorCorrectionLevel;\n        if (data.length != _QrCode.getNumDataCodewords(ver, ecl)) throw new RangeError(\"Invalid argument\");\n        var numBlocks = _QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n        var blockEccLen = _QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver];\n        var rawCodewords = Math.floor(_QrCode.getNumRawDataModules(ver) / 8);\n        var numShortBlocks = numBlocks - rawCodewords % numBlocks;\n        var shortBlockLen = Math.floor(rawCodewords / numBlocks);\n        var blocks = [];\n        var rsDiv = _QrCode.reedSolomonComputeDivisor(blockEccLen);\n        for (var i = 0, k = 0; i < numBlocks; i++) {\n          var dat = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1));\n          k += dat.length;\n          var ecc = _QrCode.reedSolomonComputeRemainder(dat, rsDiv);\n          if (i < numShortBlocks) dat.push(0);\n          blocks.push(dat.concat(ecc));\n        }\n        var result = [];\n        var _loop = function _loop(_i9) {\n          blocks.forEach(function (block, j) {\n            if (_i9 != shortBlockLen - blockEccLen || j >= numShortBlocks) result.push(block[_i9]);\n          });\n        };\n        for (var _i9 = 0; _i9 < blocks[0].length; _i9++) {\n          _loop(_i9);\n        }\n        assert(result.length == rawCodewords);\n        return result;\n      }\n    }, {\n      key: \"drawCodewords\",\n      value: function drawCodewords(data) {\n        if (data.length != Math.floor(_QrCode.getNumRawDataModules(this.version) / 8)) throw new RangeError(\"Invalid argument\");\n        var i = 0;\n        for (var right = this.size - 1; right >= 1; right -= 2) {\n          if (right == 6) right = 5;\n          for (var vert = 0; vert < this.size; vert++) {\n            for (var j = 0; j < 2; j++) {\n              var x = right - j;\n              var upward = (right + 1 & 2) == 0;\n              var y = upward ? this.size - 1 - vert : vert;\n              if (!this.isFunction[y][x] && i < data.length * 8) {\n                this.modules[y][x] = getBit(data[i >>> 3], 7 - (i & 7));\n                i++;\n              }\n            }\n          }\n        }\n        assert(i == data.length * 8);\n      }\n    }, {\n      key: \"applyMask\",\n      value: function applyMask(mask) {\n        if (mask < 0 || mask > 7) throw new RangeError(\"Mask value out of range\");\n        for (var y = 0; y < this.size; y++) {\n          for (var x = 0; x < this.size; x++) {\n            var invert = void 0;\n            switch (mask) {\n              case 0:\n                invert = (x + y) % 2 == 0;\n                break;\n              case 1:\n                invert = y % 2 == 0;\n                break;\n              case 2:\n                invert = x % 3 == 0;\n                break;\n              case 3:\n                invert = (x + y) % 3 == 0;\n                break;\n              case 4:\n                invert = (Math.floor(x / 3) + Math.floor(y / 2)) % 2 == 0;\n                break;\n              case 5:\n                invert = x * y % 2 + x * y % 3 == 0;\n                break;\n              case 6:\n                invert = (x * y % 2 + x * y % 3) % 2 == 0;\n                break;\n              case 7:\n                invert = ((x + y) % 2 + x * y % 3) % 2 == 0;\n                break;\n              default:\n                throw new Error(\"Unreachable\");\n            }\n            if (!this.isFunction[y][x] && invert) this.modules[y][x] = !this.modules[y][x];\n          }\n        }\n      }\n    }, {\n      key: \"getPenaltyScore\",\n      value: function getPenaltyScore() {\n        var result = 0;\n        for (var y = 0; y < this.size; y++) {\n          var runColor = false;\n          var runX = 0;\n          var runHistory = [0, 0, 0, 0, 0, 0, 0];\n          for (var x = 0; x < this.size; x++) {\n            if (this.modules[y][x] == runColor) {\n              runX++;\n              if (runX == 5) result += _QrCode.PENALTY_N1;else if (runX > 5) result++;\n            } else {\n              this.finderPenaltyAddHistory(runX, runHistory);\n              if (!runColor) result += this.finderPenaltyCountPatterns(runHistory) * _QrCode.PENALTY_N3;\n              runColor = this.modules[y][x];\n              runX = 1;\n            }\n          }\n          result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * _QrCode.PENALTY_N3;\n        }\n        for (var _x = 0; _x < this.size; _x++) {\n          var _runColor = false;\n          var runY = 0;\n          var _runHistory = [0, 0, 0, 0, 0, 0, 0];\n          for (var _y = 0; _y < this.size; _y++) {\n            if (this.modules[_y][_x] == _runColor) {\n              runY++;\n              if (runY == 5) result += _QrCode.PENALTY_N1;else if (runY > 5) result++;\n            } else {\n              this.finderPenaltyAddHistory(runY, _runHistory);\n              if (!_runColor) result += this.finderPenaltyCountPatterns(_runHistory) * _QrCode.PENALTY_N3;\n              _runColor = this.modules[_y][_x];\n              runY = 1;\n            }\n          }\n          result += this.finderPenaltyTerminateAndCount(_runColor, runY, _runHistory) * _QrCode.PENALTY_N3;\n        }\n        for (var _y2 = 0; _y2 < this.size - 1; _y2++) {\n          for (var _x2 = 0; _x2 < this.size - 1; _x2++) {\n            var color = this.modules[_y2][_x2];\n            if (color == this.modules[_y2][_x2 + 1] && color == this.modules[_y2 + 1][_x2] && color == this.modules[_y2 + 1][_x2 + 1]) result += _QrCode.PENALTY_N2;\n          }\n        }\n        var dark = 0;\n        var _iterator3 = _createForOfIteratorHelper(this.modules),\n          _step3;\n        try {\n          for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n            var row = _step3.value;\n            dark = row.reduce(function (sum, color) {\n              return sum + (color ? 1 : 0);\n            }, dark);\n          }\n        } catch (err) {\n          _iterator3.e(err);\n        } finally {\n          _iterator3.f();\n        }\n        var total = this.size * this.size;\n        var k = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;\n        assert(0 <= k && k <= 9);\n        result += k * _QrCode.PENALTY_N4;\n        assert(0 <= result && result <= 2568888);\n        return result;\n      }\n    }, {\n      key: \"getAlignmentPatternPositions\",\n      value: function getAlignmentPatternPositions() {\n        if (this.version == 1) return [];else {\n          var numAlign = Math.floor(this.version / 7) + 2;\n          var step = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2;\n          var result = [6];\n          for (var pos = this.size - 7; result.length < numAlign; pos -= step) {\n            result.splice(1, 0, pos);\n          }\n          return result;\n        }\n      }\n    }, {\n      key: \"finderPenaltyCountPatterns\",\n      value: function finderPenaltyCountPatterns(runHistory) {\n        var n = runHistory[1];\n        assert(n <= this.size * 3);\n        var core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;\n        return (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0) + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);\n      }\n    }, {\n      key: \"finderPenaltyTerminateAndCount\",\n      value: function finderPenaltyTerminateAndCount(currentRunColor, currentRunLength, runHistory) {\n        if (currentRunColor) {\n          this.finderPenaltyAddHistory(currentRunLength, runHistory);\n          currentRunLength = 0;\n        }\n        currentRunLength += this.size;\n        this.finderPenaltyAddHistory(currentRunLength, runHistory);\n        return this.finderPenaltyCountPatterns(runHistory);\n      }\n    }, {\n      key: \"finderPenaltyAddHistory\",\n      value: function finderPenaltyAddHistory(currentRunLength, runHistory) {\n        if (runHistory[0] == 0) currentRunLength += this.size;\n        runHistory.pop();\n        runHistory.unshift(currentRunLength);\n      }\n    }], [{\n      key: \"encodeText\",\n      value: function encodeText(text, ecl) {\n        var segs = qrcodegen2.QrSegment.makeSegments(text);\n        return _QrCode.encodeSegments(segs, ecl);\n      }\n    }, {\n      key: \"encodeBinary\",\n      value: function encodeBinary(data, ecl) {\n        var seg = qrcodegen2.QrSegment.makeBytes(data);\n        return _QrCode.encodeSegments([seg], ecl);\n      }\n    }, {\n      key: \"encodeSegments\",\n      value: function encodeSegments(segs, ecl) {\n        var minVersion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n        var maxVersion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 40;\n        var mask = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1;\n        var boostEcl = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n        if (!(_QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= _QrCode.MAX_VERSION) || mask < -1 || mask > 7) throw new RangeError(\"Invalid value\");\n        var version;\n        var dataUsedBits;\n        for (version = minVersion;; version++) {\n          var dataCapacityBits2 = _QrCode.getNumDataCodewords(version, ecl) * 8;\n          var usedBits = QrSegment.getTotalBits(segs, version);\n          if (usedBits <= dataCapacityBits2) {\n            dataUsedBits = usedBits;\n            break;\n          }\n          if (version >= maxVersion) throw new RangeError(\"Data too long\");\n        }\n        for (var _i10 = 0, _arr = [_QrCode.Ecc.MEDIUM, _QrCode.Ecc.QUARTILE, _QrCode.Ecc.HIGH]; _i10 < _arr.length; _i10++) {\n          var newEcl = _arr[_i10];\n          if (boostEcl && dataUsedBits <= _QrCode.getNumDataCodewords(version, newEcl) * 8) ecl = newEcl;\n        }\n        var bb = [];\n        var _iterator4 = _createForOfIteratorHelper(segs),\n          _step4;\n        try {\n          for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n            var seg = _step4.value;\n            appendBits(seg.mode.modeBits, 4, bb);\n            appendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);\n            var _iterator5 = _createForOfIteratorHelper(seg.getData()),\n              _step5;\n            try {\n              for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n                var b = _step5.value;\n                bb.push(b);\n              }\n            } catch (err) {\n              _iterator5.e(err);\n            } finally {\n              _iterator5.f();\n            }\n          }\n        } catch (err) {\n          _iterator4.e(err);\n        } finally {\n          _iterator4.f();\n        }\n        assert(bb.length == dataUsedBits);\n        var dataCapacityBits = _QrCode.getNumDataCodewords(version, ecl) * 8;\n        assert(bb.length <= dataCapacityBits);\n        appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);\n        appendBits(0, (8 - bb.length % 8) % 8, bb);\n        assert(bb.length % 8 == 0);\n        for (var padByte = 236; bb.length < dataCapacityBits; padByte ^= 236 ^ 17) {\n          appendBits(padByte, 8, bb);\n        }\n        var dataCodewords = [];\n        while (dataCodewords.length * 8 < bb.length) {\n          dataCodewords.push(0);\n        }\n        bb.forEach(function (b, i) {\n          return dataCodewords[i >>> 3] |= b << 7 - (i & 7);\n        });\n        return new _QrCode(version, ecl, dataCodewords, mask);\n      }\n    }, {\n      key: \"getNumRawDataModules\",\n      value: function getNumRawDataModules(ver) {\n        if (ver < _QrCode.MIN_VERSION || ver > _QrCode.MAX_VERSION) throw new RangeError(\"Version number out of range\");\n        var result = (16 * ver + 128) * ver + 64;\n        if (ver >= 2) {\n          var numAlign = Math.floor(ver / 7) + 2;\n          result -= (25 * numAlign - 10) * numAlign - 55;\n          if (ver >= 7) result -= 36;\n        }\n        assert(208 <= result && result <= 29648);\n        return result;\n      }\n    }, {\n      key: \"getNumDataCodewords\",\n      value: function getNumDataCodewords(ver, ecl) {\n        return Math.floor(_QrCode.getNumRawDataModules(ver) / 8) - _QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] * _QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n      }\n    }, {\n      key: \"reedSolomonComputeDivisor\",\n      value: function reedSolomonComputeDivisor(degree) {\n        if (degree < 1 || degree > 255) throw new RangeError(\"Degree out of range\");\n        var result = [];\n        for (var i = 0; i < degree - 1; i++) {\n          result.push(0);\n        }\n        result.push(1);\n        var root = 1;\n        for (var _i11 = 0; _i11 < degree; _i11++) {\n          for (var j = 0; j < result.length; j++) {\n            result[j] = _QrCode.reedSolomonMultiply(result[j], root);\n            if (j + 1 < result.length) result[j] ^= result[j + 1];\n          }\n          root = _QrCode.reedSolomonMultiply(root, 2);\n        }\n        return result;\n      }\n    }, {\n      key: \"reedSolomonComputeRemainder\",\n      value: function reedSolomonComputeRemainder(data, divisor) {\n        var result = divisor.map(function (_) {\n          return 0;\n        });\n        var _iterator6 = _createForOfIteratorHelper(data),\n          _step6;\n        try {\n          var _loop2 = function _loop2() {\n            var b = _step6.value;\n            var factor = b ^ result.shift();\n            result.push(0);\n            divisor.forEach(function (coef, i) {\n              return result[i] ^= _QrCode.reedSolomonMultiply(coef, factor);\n            });\n          };\n          for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n            _loop2();\n          }\n        } catch (err) {\n          _iterator6.e(err);\n        } finally {\n          _iterator6.f();\n        }\n        return result;\n      }\n    }, {\n      key: \"reedSolomonMultiply\",\n      value: function reedSolomonMultiply(x, y) {\n        if (x >>> 8 != 0 || y >>> 8 != 0) throw new RangeError(\"Byte out of range\");\n        var z = 0;\n        for (var i = 7; i >= 0; i--) {\n          z = z << 1 ^ (z >>> 7) * 285;\n          z ^= (y >>> i & 1) * x;\n        }\n        assert(z >>> 8 == 0);\n        return z;\n      }\n    }]);\n    return _QrCode;\n  }();\n  var QrCode = _QrCode;\n  QrCode.MIN_VERSION = 1;\n  QrCode.MAX_VERSION = 40;\n  QrCode.PENALTY_N1 = 3;\n  QrCode.PENALTY_N2 = 3;\n  QrCode.PENALTY_N3 = 40;\n  QrCode.PENALTY_N4 = 10;\n  QrCode.ECC_CODEWORDS_PER_BLOCK = [[-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28], [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]];\n  QrCode.NUM_ERROR_CORRECTION_BLOCKS = [[-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25], [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49], [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68], [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]];\n  qrcodegen2.QrCode = QrCode;\n  function appendBits(val, len, bb) {\n    if (len < 0 || len > 31 || val >>> len != 0) throw new RangeError(\"Value out of range\");\n    for (var i = len - 1; i >= 0; i--) {\n      bb.push(val >>> i & 1);\n    }\n  }\n  function getBit(x, i) {\n    return (x >>> i & 1) != 0;\n  }\n  function assert(cond) {\n    if (!cond) throw new Error(\"Assertion error\");\n  }\n  var _QrSegment = /*#__PURE__*/function () {\n    function _QrSegment(mode, numChars, bitData) {\n      _classCallCheck(this, _QrSegment);\n      this.mode = mode;\n      this.numChars = numChars;\n      this.bitData = bitData;\n      if (numChars < 0) throw new RangeError(\"Invalid argument\");\n      this.bitData = bitData.slice();\n    }\n    _createClass(_QrSegment, [{\n      key: \"getData\",\n      value: function getData() {\n        return this.bitData.slice();\n      }\n    }], [{\n      key: \"makeBytes\",\n      value: function makeBytes(data) {\n        var bb = [];\n        var _iterator7 = _createForOfIteratorHelper(data),\n          _step7;\n        try {\n          for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n            var b = _step7.value;\n            appendBits(b, 8, bb);\n          }\n        } catch (err) {\n          _iterator7.e(err);\n        } finally {\n          _iterator7.f();\n        }\n        return new _QrSegment(_QrSegment.Mode.BYTE, data.length, bb);\n      }\n    }, {\n      key: \"makeNumeric\",\n      value: function makeNumeric(digits) {\n        if (!_QrSegment.isNumeric(digits)) throw new RangeError(\"String contains non-numeric characters\");\n        var bb = [];\n        for (var i = 0; i < digits.length;) {\n          var n = Math.min(digits.length - i, 3);\n          appendBits(parseInt(digits.substr(i, n), 10), n * 3 + 1, bb);\n          i += n;\n        }\n        return new _QrSegment(_QrSegment.Mode.NUMERIC, digits.length, bb);\n      }\n    }, {\n      key: \"makeAlphanumeric\",\n      value: function makeAlphanumeric(text) {\n        if (!_QrSegment.isAlphanumeric(text)) throw new RangeError(\"String contains unencodable characters in alphanumeric mode\");\n        var bb = [];\n        var i;\n        for (i = 0; i + 2 <= text.length; i += 2) {\n          var temp = _QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;\n          temp += _QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));\n          appendBits(temp, 11, bb);\n        }\n        if (i < text.length) appendBits(_QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)), 6, bb);\n        return new _QrSegment(_QrSegment.Mode.ALPHANUMERIC, text.length, bb);\n      }\n    }, {\n      key: \"makeSegments\",\n      value: function makeSegments(text) {\n        if (text == \"\") return [];else if (_QrSegment.isNumeric(text)) return [_QrSegment.makeNumeric(text)];else if (_QrSegment.isAlphanumeric(text)) return [_QrSegment.makeAlphanumeric(text)];else return [_QrSegment.makeBytes(_QrSegment.toUtf8ByteArray(text))];\n      }\n    }, {\n      key: \"makeEci\",\n      value: function makeEci(assignVal) {\n        var bb = [];\n        if (assignVal < 0) throw new RangeError(\"ECI assignment value out of range\");else if (assignVal < 1 << 7) appendBits(assignVal, 8, bb);else if (assignVal < 1 << 14) {\n          appendBits(2, 2, bb);\n          appendBits(assignVal, 14, bb);\n        } else if (assignVal < 1e6) {\n          appendBits(6, 3, bb);\n          appendBits(assignVal, 21, bb);\n        } else throw new RangeError(\"ECI assignment value out of range\");\n        return new _QrSegment(_QrSegment.Mode.ECI, 0, bb);\n      }\n    }, {\n      key: \"isNumeric\",\n      value: function isNumeric(text) {\n        return _QrSegment.NUMERIC_REGEX.test(text);\n      }\n    }, {\n      key: \"isAlphanumeric\",\n      value: function isAlphanumeric(text) {\n        return _QrSegment.ALPHANUMERIC_REGEX.test(text);\n      }\n    }, {\n      key: \"getTotalBits\",\n      value: function getTotalBits(segs, version) {\n        var result = 0;\n        var _iterator8 = _createForOfIteratorHelper(segs),\n          _step8;\n        try {\n          for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n            var seg = _step8.value;\n            var ccbits = seg.mode.numCharCountBits(version);\n            if (seg.numChars >= 1 << ccbits) return Infinity;\n            result += 4 + ccbits + seg.bitData.length;\n          }\n        } catch (err) {\n          _iterator8.e(err);\n        } finally {\n          _iterator8.f();\n        }\n        return result;\n      }\n    }, {\n      key: \"toUtf8ByteArray\",\n      value: function toUtf8ByteArray(str) {\n        str = encodeURI(str);\n        var result = [];\n        for (var i = 0; i < str.length; i++) {\n          if (str.charAt(i) != \"%\") result.push(str.charCodeAt(i));else {\n            result.push(parseInt(str.substr(i + 1, 2), 16));\n            i += 2;\n          }\n        }\n        return result;\n      }\n    }]);\n    return _QrSegment;\n  }();\n  var QrSegment = _QrSegment;\n  QrSegment.NUMERIC_REGEX = /^[0-9]*$/;\n  QrSegment.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\\/:-]*$/;\n  QrSegment.ALPHANUMERIC_CHARSET = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:\";\n  qrcodegen2.QrSegment = QrSegment;\n})(qrcodegen || (qrcodegen = {}));\n(function (qrcodegen2) {\n  var QrCode;\n  (function (QrCode2) {\n    var _Ecc = /*#__PURE__*/_createClass(function _Ecc(ordinal, formatBits) {\n      _classCallCheck(this, _Ecc);\n      this.ordinal = ordinal;\n      this.formatBits = formatBits;\n    });\n    var Ecc = _Ecc;\n    Ecc.LOW = new _Ecc(0, 1);\n    Ecc.MEDIUM = new _Ecc(1, 0);\n    Ecc.QUARTILE = new _Ecc(2, 3);\n    Ecc.HIGH = new _Ecc(3, 2);\n    QrCode2.Ecc = Ecc;\n  })(QrCode = qrcodegen2.QrCode || (qrcodegen2.QrCode = {}));\n})(qrcodegen || (qrcodegen = {}));\n(function (qrcodegen2) {\n  var QrSegment;\n  (function (QrSegment2) {\n    var _Mode = /*#__PURE__*/function () {\n      function _Mode(modeBits, numBitsCharCount) {\n        _classCallCheck(this, _Mode);\n        this.modeBits = modeBits;\n        this.numBitsCharCount = numBitsCharCount;\n      }\n      _createClass(_Mode, [{\n        key: \"numCharCountBits\",\n        value: function numCharCountBits(ver) {\n          return this.numBitsCharCount[Math.floor((ver + 7) / 17)];\n        }\n      }]);\n      return _Mode;\n    }();\n    var Mode = _Mode;\n    Mode.NUMERIC = new _Mode(1, [10, 12, 14]);\n    Mode.ALPHANUMERIC = new _Mode(2, [9, 11, 13]);\n    Mode.BYTE = new _Mode(4, [8, 16, 16]);\n    Mode.KANJI = new _Mode(8, [8, 10, 12]);\n    Mode.ECI = new _Mode(7, [0, 0, 0]);\n    QrSegment2.Mode = Mode;\n  })(QrSegment = qrcodegen2.QrSegment || (qrcodegen2.QrSegment = {}));\n})(qrcodegen || (qrcodegen = {}));\nvar qrcodegen_default = qrcodegen;\n\n// src/index.tsx\n/**\n * @license qrcode.react\n * Copyright (c) Paul O'Shannessy\n * SPDX-License-Identifier: ISC\n */\nvar ERROR_LEVEL_MAP = {\n  L: qrcodegen_default.QrCode.Ecc.LOW,\n  M: qrcodegen_default.QrCode.Ecc.MEDIUM,\n  Q: qrcodegen_default.QrCode.Ecc.QUARTILE,\n  H: qrcodegen_default.QrCode.Ecc.HIGH\n};\nvar DEFAULT_SIZE = 128;\nvar DEFAULT_LEVEL = \"L\";\nvar DEFAULT_BGCOLOR = \"#FFFFFF\";\nvar DEFAULT_FGCOLOR = \"#000000\";\nvar DEFAULT_INCLUDEMARGIN = false;\nvar MARGIN_SIZE = 4;\nvar DEFAULT_IMG_SCALE = 0.1;\nfunction generatePath(modules) {\n  var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n  var ops = [];\n  modules.forEach(function (row, y) {\n    var start = null;\n    row.forEach(function (cell, x) {\n      if (!cell && start !== null) {\n        ops.push(\"M\".concat(start + margin, \" \").concat(y + margin, \"h\").concat(x - start, \"v1H\").concat(start + margin, \"z\"));\n        start = null;\n        return;\n      }\n      if (x === row.length - 1) {\n        if (!cell) {\n          return;\n        }\n        if (start === null) {\n          ops.push(\"M\".concat(x + margin, \",\").concat(y + margin, \" h1v1H\").concat(x + margin, \"z\"));\n        } else {\n          ops.push(\"M\".concat(start + margin, \",\").concat(y + margin, \" h\").concat(x + 1 - start, \"v1H\").concat(start + margin, \"z\"));\n        }\n        return;\n      }\n      if (cell && start === null) {\n        start = x;\n      }\n    });\n  });\n  return ops.join(\"\");\n}\nfunction excavateModules(modules, excavation) {\n  return modules.slice().map(function (row, y) {\n    if (y < excavation.y || y >= excavation.y + excavation.h) {\n      return row;\n    }\n    return row.map(function (cell, x) {\n      if (x < excavation.x || x >= excavation.x + excavation.w) {\n        return cell;\n      }\n      return false;\n    });\n  });\n}\nfunction getImageSettings(cells, size, includeMargin, imageSettings) {\n  if (imageSettings == null) {\n    return null;\n  }\n  var margin = includeMargin ? MARGIN_SIZE : 0;\n  var numCells = cells.length + margin * 2;\n  var defaultSize = Math.floor(size * DEFAULT_IMG_SCALE);\n  var scale = numCells / size;\n  var w = (imageSettings.width || defaultSize) * scale;\n  var h = (imageSettings.height || defaultSize) * scale;\n  var x = imageSettings.x == null ? cells.length / 2 - w / 2 : imageSettings.x * scale;\n  var y = imageSettings.y == null ? cells.length / 2 - h / 2 : imageSettings.y * scale;\n  var excavation = null;\n  if (imageSettings.excavate) {\n    var floorX = Math.floor(x);\n    var floorY = Math.floor(y);\n    var ceilW = Math.ceil(w + x - floorX);\n    var ceilH = Math.ceil(h + y - floorY);\n    excavation = {\n      x: floorX,\n      y: floorY,\n      w: ceilW,\n      h: ceilH\n    };\n  }\n  return {\n    x: x,\n    y: y,\n    h: h,\n    w: w,\n    excavation: excavation\n  };\n}\nvar SUPPORTS_PATH2D = function () {\n  try {\n    new Path2D().addPath(new Path2D());\n  } catch (e) {\n    return false;\n  }\n  return true;\n}();\nfunction QRCodeCanvas(props) {\n  var _a = props,\n    value = _a.value,\n    _a$size = _a.size,\n    size = _a$size === void 0 ? DEFAULT_SIZE : _a$size,\n    _a$level = _a.level,\n    level = _a$level === void 0 ? DEFAULT_LEVEL : _a$level,\n    _a$bgColor = _a.bgColor,\n    bgColor = _a$bgColor === void 0 ? DEFAULT_BGCOLOR : _a$bgColor,\n    _a$fgColor = _a.fgColor,\n    fgColor = _a$fgColor === void 0 ? DEFAULT_FGCOLOR : _a$fgColor,\n    _a$includeMargin = _a.includeMargin,\n    includeMargin = _a$includeMargin === void 0 ? DEFAULT_INCLUDEMARGIN : _a$includeMargin,\n    style = _a.style,\n    imageSettings = _a.imageSettings,\n    otherProps = __objRest(_a, [\"value\", \"size\", \"level\", \"bgColor\", \"fgColor\", \"includeMargin\", \"style\", \"imageSettings\"]);\n  var imgSrc = imageSettings == null ? void 0 : imageSettings.src;\n  var _canvas = useRef(null);\n  var _image = useRef(null);\n  var _useState = useState(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    isImgLoaded = _useState2[0],\n    setIsImageLoaded = _useState2[1];\n  useEffect(function () {\n    if (_canvas.current != null) {\n      var canvas = _canvas.current;\n      var ctx = canvas.getContext(\"2d\");\n      if (!ctx) {\n        return;\n      }\n      var cells = qrcodegen_default.QrCode.encodeText(value, ERROR_LEVEL_MAP[level]).getModules();\n      var margin = includeMargin ? MARGIN_SIZE : 0;\n      var numCells = cells.length + margin * 2;\n      var calculatedImageSettings = getImageSettings(cells, size, includeMargin, imageSettings);\n      var image = _image.current;\n      var haveImageToRender = calculatedImageSettings != null && image !== null && image.complete && image.naturalHeight !== 0 && image.naturalWidth !== 0;\n      if (haveImageToRender) {\n        if (calculatedImageSettings.excavation != null) {\n          cells = excavateModules(cells, calculatedImageSettings.excavation);\n        }\n      }\n      var pixelRatio = window.devicePixelRatio || 1;\n      canvas.height = canvas.width = size * pixelRatio;\n      var scale = size / numCells * pixelRatio;\n      ctx.scale(scale, scale);\n      ctx.fillStyle = bgColor;\n      ctx.fillRect(0, 0, numCells, numCells);\n      ctx.fillStyle = fgColor;\n      if (SUPPORTS_PATH2D) {\n        ctx.fill(new Path2D(generatePath(cells, margin)));\n      } else {\n        cells.forEach(function (row, rdx) {\n          row.forEach(function (cell, cdx) {\n            if (cell) {\n              ctx.fillRect(cdx + margin, rdx + margin, 1, 1);\n            }\n          });\n        });\n      }\n      if (haveImageToRender) {\n        ctx.drawImage(image, calculatedImageSettings.x + margin, calculatedImageSettings.y + margin, calculatedImageSettings.w, calculatedImageSettings.h);\n      }\n    }\n  });\n  useEffect(function () {\n    setIsImageLoaded(false);\n  }, [imgSrc]);\n  var canvasStyle = __spreadValues({\n    height: size,\n    width: size\n  }, style);\n  var img = null;\n  if (imgSrc != null) {\n    img = /* @__PURE__ */React.createElement(\"img\", {\n      src: imgSrc,\n      key: imgSrc,\n      style: {\n        display: \"none\"\n      },\n      onLoad: function onLoad() {\n        setIsImageLoaded(true);\n      },\n      ref: _image\n    });\n  }\n  return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(\"canvas\", __spreadValues({\n    style: canvasStyle,\n    height: size,\n    width: size,\n    ref: _canvas\n  }, otherProps)), img);\n}\nfunction QRCodeSVG(props) {\n  var _a = props,\n    value = _a.value,\n    _a$size2 = _a.size,\n    size = _a$size2 === void 0 ? DEFAULT_SIZE : _a$size2,\n    _a$level2 = _a.level,\n    level = _a$level2 === void 0 ? DEFAULT_LEVEL : _a$level2,\n    _a$bgColor2 = _a.bgColor,\n    bgColor = _a$bgColor2 === void 0 ? DEFAULT_BGCOLOR : _a$bgColor2,\n    _a$fgColor2 = _a.fgColor,\n    fgColor = _a$fgColor2 === void 0 ? DEFAULT_FGCOLOR : _a$fgColor2,\n    _a$includeMargin2 = _a.includeMargin,\n    includeMargin = _a$includeMargin2 === void 0 ? DEFAULT_INCLUDEMARGIN : _a$includeMargin2,\n    imageSettings = _a.imageSettings,\n    otherProps = __objRest(_a, [\"value\", \"size\", \"level\", \"bgColor\", \"fgColor\", \"includeMargin\", \"imageSettings\"]);\n  var cells = qrcodegen_default.QrCode.encodeText(value, ERROR_LEVEL_MAP[level]).getModules();\n  var margin = includeMargin ? MARGIN_SIZE : 0;\n  var numCells = cells.length + margin * 2;\n  var calculatedImageSettings = getImageSettings(cells, size, includeMargin, imageSettings);\n  var image = null;\n  if (imageSettings != null && calculatedImageSettings != null) {\n    if (calculatedImageSettings.excavation != null) {\n      cells = excavateModules(cells, calculatedImageSettings.excavation);\n    }\n    image = /* @__PURE__ */React.createElement(\"image\", {\n      xlinkHref: imageSettings.src,\n      height: calculatedImageSettings.h,\n      width: calculatedImageSettings.w,\n      x: calculatedImageSettings.x + margin,\n      y: calculatedImageSettings.y + margin,\n      preserveAspectRatio: \"none\"\n    });\n  }\n  var fgPath = generatePath(cells, margin);\n  return /* @__PURE__ */React.createElement(\"svg\", __spreadValues({\n    height: size,\n    width: size,\n    viewBox: \"0 0 \".concat(numCells, \" \").concat(numCells)\n  }, otherProps), /* @__PURE__ */React.createElement(\"path\", {\n    fill: bgColor,\n    d: \"M0,0 h\".concat(numCells, \"v\").concat(numCells, \"H0z\"),\n    shapeRendering: \"crispEdges\"\n  }), /* @__PURE__ */React.createElement(\"path\", {\n    fill: fgColor,\n    d: fgPath,\n    shapeRendering: \"crispEdges\"\n  }), image);\n}\nvar QRCode = function QRCode(props) {\n  var _a = props,\n    renderAs = _a.renderAs,\n    otherProps = __objRest(_a, [\"renderAs\"]);\n  if (renderAs === \"svg\") {\n    return /* @__PURE__ */React.createElement(QRCodeSVG, __spreadValues({}, otherProps));\n  }\n  return /* @__PURE__ */React.createElement(QRCodeCanvas, __spreadValues({}, otherProps));\n};\nexport { QRCodeCanvas, QRCodeSVG, QRCode as default };","map":{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropSymbols","getOwnPropertySymbols","__hasOwnProp","prototype","hasOwnProperty","__propIsEnum","propertyIsEnumerable","__defNormalProp","obj","key","value","enumerable","configurable","writable","__spreadValues","a","b","prop","call","__objRest","source","exclude","target","indexOf","React","useRef","useEffect","useState","qrcodegen","qrcodegen2","_QrCode","version","errorCorrectionLevel","dataCodewords","msk","modules","isFunction","MIN_VERSION","MAX_VERSION","RangeError","size","row","i","push","slice","drawFunctionPatterns","allCodewords","addEccAndInterleave","drawCodewords","minPenalty","applyMask","drawFormatBits","penalty","getPenaltyScore","assert","mask","x","y","setFunctionModule","drawFinderPattern","alignPatPos","getAlignmentPatternPositions","numAlign","length","j","drawAlignmentPattern","drawVersion","data","formatBits","rem","bits","getBit","color","Math","floor","dy","dx","dist","max","abs","xx","yy","isDark","ver","ecl","getNumDataCodewords","numBlocks","NUM_ERROR_CORRECTION_BLOCKS","ordinal","blockEccLen","ECC_CODEWORDS_PER_BLOCK","rawCodewords","getNumRawDataModules","numShortBlocks","shortBlockLen","blocks","rsDiv","reedSolomonComputeDivisor","k","dat","ecc","reedSolomonComputeRemainder","concat","result","forEach","block","right","vert","upward","invert","Error","runColor","runX","runHistory","PENALTY_N1","finderPenaltyAddHistory","finderPenaltyCountPatterns","PENALTY_N3","finderPenaltyTerminateAndCount","runY","PENALTY_N2","dark","reduce","sum","total","ceil","PENALTY_N4","step","pos","splice","n","core","currentRunColor","currentRunLength","pop","unshift","text","segs","QrSegment","makeSegments","encodeSegments","seg","makeBytes","minVersion","maxVersion","boostEcl","dataUsedBits","dataCapacityBits2","usedBits","getTotalBits","Ecc","MEDIUM","QUARTILE","HIGH","newEcl","bb","appendBits","mode","modeBits","numChars","numCharCountBits","getData","dataCapacityBits","min","padByte","degree","root","reedSolomonMultiply","divisor","map","_","factor","shift","coef","z","QrCode","val","len","cond","_QrSegment","bitData","Mode","BYTE","digits","isNumeric","parseInt","substr","NUMERIC","isAlphanumeric","temp","ALPHANUMERIC_CHARSET","charAt","ALPHANUMERIC","makeNumeric","makeAlphanumeric","toUtf8ByteArray","assignVal","ECI","NUMERIC_REGEX","test","ALPHANUMERIC_REGEX","ccbits","Infinity","str","encodeURI","charCodeAt","QrCode2","_Ecc","LOW","QrSegment2","_Mode","numBitsCharCount","KANJI","qrcodegen_default","ERROR_LEVEL_MAP","L","M","Q","H","DEFAULT_SIZE","DEFAULT_LEVEL","DEFAULT_BGCOLOR","DEFAULT_FGCOLOR","DEFAULT_INCLUDEMARGIN","MARGIN_SIZE","DEFAULT_IMG_SCALE","generatePath","margin","ops","start","cell","join","excavateModules","excavation","h","w","getImageSettings","cells","includeMargin","imageSettings","numCells","defaultSize","scale","width","height","excavate","floorX","floorY","ceilW","ceilH","SUPPORTS_PATH2D","Path2D","addPath","e","QRCodeCanvas","props","_a","level","bgColor","fgColor","style","otherProps","imgSrc","src","_canvas","_image","isImgLoaded","setIsImageLoaded","current","canvas","ctx","getContext","encodeText","getModules","calculatedImageSettings","image","haveImageToRender","complete","naturalHeight","naturalWidth","pixelRatio","window","devicePixelRatio","fillStyle","fillRect","fill","rdx","cdx","drawImage","canvasStyle","img","createElement","display","onLoad","ref","Fragment","QRCodeSVG","xlinkHref","preserveAspectRatio","fgPath","viewBox","d","shapeRendering","QRCode","renderAs","default"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/qrcode.react/lib/esm/index.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n  for (var prop in b || (b = {}))\n    if (__hasOwnProp.call(b, prop))\n      __defNormalProp(a, prop, b[prop]);\n  if (__getOwnPropSymbols)\n    for (var prop of __getOwnPropSymbols(b)) {\n      if (__propIsEnum.call(b, prop))\n        __defNormalProp(a, prop, b[prop]);\n    }\n  return a;\n};\nvar __objRest = (source, exclude) => {\n  var target = {};\n  for (var prop in source)\n    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n      target[prop] = source[prop];\n  if (source != null && __getOwnPropSymbols)\n    for (var prop of __getOwnPropSymbols(source)) {\n      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n        target[prop] = source[prop];\n    }\n  return target;\n};\n\n// src/index.tsx\nimport React, { useRef, useEffect, useState } from \"react\";\n\n// src/third-party/qrcodegen/index.ts\n/**\n * @license QR Code generator library (TypeScript)\n * Copyright (c) Project Nayuki.\n * SPDX-License-Identifier: MIT\n */\nvar qrcodegen;\n((qrcodegen2) => {\n  const _QrCode = class {\n    constructor(version, errorCorrectionLevel, dataCodewords, msk) {\n      this.version = version;\n      this.errorCorrectionLevel = errorCorrectionLevel;\n      this.modules = [];\n      this.isFunction = [];\n      if (version < _QrCode.MIN_VERSION || version > _QrCode.MAX_VERSION)\n        throw new RangeError(\"Version value out of range\");\n      if (msk < -1 || msk > 7)\n        throw new RangeError(\"Mask value out of range\");\n      this.size = version * 4 + 17;\n      let row = [];\n      for (let i = 0; i < this.size; i++)\n        row.push(false);\n      for (let i = 0; i < this.size; i++) {\n        this.modules.push(row.slice());\n        this.isFunction.push(row.slice());\n      }\n      this.drawFunctionPatterns();\n      const allCodewords = this.addEccAndInterleave(dataCodewords);\n      this.drawCodewords(allCodewords);\n      if (msk == -1) {\n        let minPenalty = 1e9;\n        for (let i = 0; i < 8; i++) {\n          this.applyMask(i);\n          this.drawFormatBits(i);\n          const penalty = this.getPenaltyScore();\n          if (penalty < minPenalty) {\n            msk = i;\n            minPenalty = penalty;\n          }\n          this.applyMask(i);\n        }\n      }\n      assert(0 <= msk && msk <= 7);\n      this.mask = msk;\n      this.applyMask(msk);\n      this.drawFormatBits(msk);\n      this.isFunction = [];\n    }\n    static encodeText(text, ecl) {\n      const segs = qrcodegen2.QrSegment.makeSegments(text);\n      return _QrCode.encodeSegments(segs, ecl);\n    }\n    static encodeBinary(data, ecl) {\n      const seg = qrcodegen2.QrSegment.makeBytes(data);\n      return _QrCode.encodeSegments([seg], ecl);\n    }\n    static encodeSegments(segs, ecl, minVersion = 1, maxVersion = 40, mask = -1, boostEcl = true) {\n      if (!(_QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= _QrCode.MAX_VERSION) || mask < -1 || mask > 7)\n        throw new RangeError(\"Invalid value\");\n      let version;\n      let dataUsedBits;\n      for (version = minVersion; ; version++) {\n        const dataCapacityBits2 = _QrCode.getNumDataCodewords(version, ecl) * 8;\n        const usedBits = QrSegment.getTotalBits(segs, version);\n        if (usedBits <= dataCapacityBits2) {\n          dataUsedBits = usedBits;\n          break;\n        }\n        if (version >= maxVersion)\n          throw new RangeError(\"Data too long\");\n      }\n      for (const newEcl of [_QrCode.Ecc.MEDIUM, _QrCode.Ecc.QUARTILE, _QrCode.Ecc.HIGH]) {\n        if (boostEcl && dataUsedBits <= _QrCode.getNumDataCodewords(version, newEcl) * 8)\n          ecl = newEcl;\n      }\n      let bb = [];\n      for (const seg of segs) {\n        appendBits(seg.mode.modeBits, 4, bb);\n        appendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);\n        for (const b of seg.getData())\n          bb.push(b);\n      }\n      assert(bb.length == dataUsedBits);\n      const dataCapacityBits = _QrCode.getNumDataCodewords(version, ecl) * 8;\n      assert(bb.length <= dataCapacityBits);\n      appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);\n      appendBits(0, (8 - bb.length % 8) % 8, bb);\n      assert(bb.length % 8 == 0);\n      for (let padByte = 236; bb.length < dataCapacityBits; padByte ^= 236 ^ 17)\n        appendBits(padByte, 8, bb);\n      let dataCodewords = [];\n      while (dataCodewords.length * 8 < bb.length)\n        dataCodewords.push(0);\n      bb.forEach((b, i) => dataCodewords[i >>> 3] |= b << 7 - (i & 7));\n      return new _QrCode(version, ecl, dataCodewords, mask);\n    }\n    getModule(x, y) {\n      return 0 <= x && x < this.size && 0 <= y && y < this.size && this.modules[y][x];\n    }\n    getModules() {\n      return this.modules;\n    }\n    drawFunctionPatterns() {\n      for (let i = 0; i < this.size; i++) {\n        this.setFunctionModule(6, i, i % 2 == 0);\n        this.setFunctionModule(i, 6, i % 2 == 0);\n      }\n      this.drawFinderPattern(3, 3);\n      this.drawFinderPattern(this.size - 4, 3);\n      this.drawFinderPattern(3, this.size - 4);\n      const alignPatPos = this.getAlignmentPatternPositions();\n      const numAlign = alignPatPos.length;\n      for (let i = 0; i < numAlign; i++) {\n        for (let j = 0; j < numAlign; j++) {\n          if (!(i == 0 && j == 0 || i == 0 && j == numAlign - 1 || i == numAlign - 1 && j == 0))\n            this.drawAlignmentPattern(alignPatPos[i], alignPatPos[j]);\n        }\n      }\n      this.drawFormatBits(0);\n      this.drawVersion();\n    }\n    drawFormatBits(mask) {\n      const data = this.errorCorrectionLevel.formatBits << 3 | mask;\n      let rem = data;\n      for (let i = 0; i < 10; i++)\n        rem = rem << 1 ^ (rem >>> 9) * 1335;\n      const bits = (data << 10 | rem) ^ 21522;\n      assert(bits >>> 15 == 0);\n      for (let i = 0; i <= 5; i++)\n        this.setFunctionModule(8, i, getBit(bits, i));\n      this.setFunctionModule(8, 7, getBit(bits, 6));\n      this.setFunctionModule(8, 8, getBit(bits, 7));\n      this.setFunctionModule(7, 8, getBit(bits, 8));\n      for (let i = 9; i < 15; i++)\n        this.setFunctionModule(14 - i, 8, getBit(bits, i));\n      for (let i = 0; i < 8; i++)\n        this.setFunctionModule(this.size - 1 - i, 8, getBit(bits, i));\n      for (let i = 8; i < 15; i++)\n        this.setFunctionModule(8, this.size - 15 + i, getBit(bits, i));\n      this.setFunctionModule(8, this.size - 8, true);\n    }\n    drawVersion() {\n      if (this.version < 7)\n        return;\n      let rem = this.version;\n      for (let i = 0; i < 12; i++)\n        rem = rem << 1 ^ (rem >>> 11) * 7973;\n      const bits = this.version << 12 | rem;\n      assert(bits >>> 18 == 0);\n      for (let i = 0; i < 18; i++) {\n        const color = getBit(bits, i);\n        const a = this.size - 11 + i % 3;\n        const b = Math.floor(i / 3);\n        this.setFunctionModule(a, b, color);\n        this.setFunctionModule(b, a, color);\n      }\n    }\n    drawFinderPattern(x, y) {\n      for (let dy = -4; dy <= 4; dy++) {\n        for (let dx = -4; dx <= 4; dx++) {\n          const dist = Math.max(Math.abs(dx), Math.abs(dy));\n          const xx = x + dx;\n          const yy = y + dy;\n          if (0 <= xx && xx < this.size && 0 <= yy && yy < this.size)\n            this.setFunctionModule(xx, yy, dist != 2 && dist != 4);\n        }\n      }\n    }\n    drawAlignmentPattern(x, y) {\n      for (let dy = -2; dy <= 2; dy++) {\n        for (let dx = -2; dx <= 2; dx++)\n          this.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);\n      }\n    }\n    setFunctionModule(x, y, isDark) {\n      this.modules[y][x] = isDark;\n      this.isFunction[y][x] = true;\n    }\n    addEccAndInterleave(data) {\n      const ver = this.version;\n      const ecl = this.errorCorrectionLevel;\n      if (data.length != _QrCode.getNumDataCodewords(ver, ecl))\n        throw new RangeError(\"Invalid argument\");\n      const numBlocks = _QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n      const blockEccLen = _QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver];\n      const rawCodewords = Math.floor(_QrCode.getNumRawDataModules(ver) / 8);\n      const numShortBlocks = numBlocks - rawCodewords % numBlocks;\n      const shortBlockLen = Math.floor(rawCodewords / numBlocks);\n      let blocks = [];\n      const rsDiv = _QrCode.reedSolomonComputeDivisor(blockEccLen);\n      for (let i = 0, k = 0; i < numBlocks; i++) {\n        let dat = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1));\n        k += dat.length;\n        const ecc = _QrCode.reedSolomonComputeRemainder(dat, rsDiv);\n        if (i < numShortBlocks)\n          dat.push(0);\n        blocks.push(dat.concat(ecc));\n      }\n      let result = [];\n      for (let i = 0; i < blocks[0].length; i++) {\n        blocks.forEach((block, j) => {\n          if (i != shortBlockLen - blockEccLen || j >= numShortBlocks)\n            result.push(block[i]);\n        });\n      }\n      assert(result.length == rawCodewords);\n      return result;\n    }\n    drawCodewords(data) {\n      if (data.length != Math.floor(_QrCode.getNumRawDataModules(this.version) / 8))\n        throw new RangeError(\"Invalid argument\");\n      let i = 0;\n      for (let right = this.size - 1; right >= 1; right -= 2) {\n        if (right == 6)\n          right = 5;\n        for (let vert = 0; vert < this.size; vert++) {\n          for (let j = 0; j < 2; j++) {\n            const x = right - j;\n            const upward = (right + 1 & 2) == 0;\n            const y = upward ? this.size - 1 - vert : vert;\n            if (!this.isFunction[y][x] && i < data.length * 8) {\n              this.modules[y][x] = getBit(data[i >>> 3], 7 - (i & 7));\n              i++;\n            }\n          }\n        }\n      }\n      assert(i == data.length * 8);\n    }\n    applyMask(mask) {\n      if (mask < 0 || mask > 7)\n        throw new RangeError(\"Mask value out of range\");\n      for (let y = 0; y < this.size; y++) {\n        for (let x = 0; x < this.size; x++) {\n          let invert;\n          switch (mask) {\n            case 0:\n              invert = (x + y) % 2 == 0;\n              break;\n            case 1:\n              invert = y % 2 == 0;\n              break;\n            case 2:\n              invert = x % 3 == 0;\n              break;\n            case 3:\n              invert = (x + y) % 3 == 0;\n              break;\n            case 4:\n              invert = (Math.floor(x / 3) + Math.floor(y / 2)) % 2 == 0;\n              break;\n            case 5:\n              invert = x * y % 2 + x * y % 3 == 0;\n              break;\n            case 6:\n              invert = (x * y % 2 + x * y % 3) % 2 == 0;\n              break;\n            case 7:\n              invert = ((x + y) % 2 + x * y % 3) % 2 == 0;\n              break;\n            default:\n              throw new Error(\"Unreachable\");\n          }\n          if (!this.isFunction[y][x] && invert)\n            this.modules[y][x] = !this.modules[y][x];\n        }\n      }\n    }\n    getPenaltyScore() {\n      let result = 0;\n      for (let y = 0; y < this.size; y++) {\n        let runColor = false;\n        let runX = 0;\n        let runHistory = [0, 0, 0, 0, 0, 0, 0];\n        for (let x = 0; x < this.size; x++) {\n          if (this.modules[y][x] == runColor) {\n            runX++;\n            if (runX == 5)\n              result += _QrCode.PENALTY_N1;\n            else if (runX > 5)\n              result++;\n          } else {\n            this.finderPenaltyAddHistory(runX, runHistory);\n            if (!runColor)\n              result += this.finderPenaltyCountPatterns(runHistory) * _QrCode.PENALTY_N3;\n            runColor = this.modules[y][x];\n            runX = 1;\n          }\n        }\n        result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * _QrCode.PENALTY_N3;\n      }\n      for (let x = 0; x < this.size; x++) {\n        let runColor = false;\n        let runY = 0;\n        let runHistory = [0, 0, 0, 0, 0, 0, 0];\n        for (let y = 0; y < this.size; y++) {\n          if (this.modules[y][x] == runColor) {\n            runY++;\n            if (runY == 5)\n              result += _QrCode.PENALTY_N1;\n            else if (runY > 5)\n              result++;\n          } else {\n            this.finderPenaltyAddHistory(runY, runHistory);\n            if (!runColor)\n              result += this.finderPenaltyCountPatterns(runHistory) * _QrCode.PENALTY_N3;\n            runColor = this.modules[y][x];\n            runY = 1;\n          }\n        }\n        result += this.finderPenaltyTerminateAndCount(runColor, runY, runHistory) * _QrCode.PENALTY_N3;\n      }\n      for (let y = 0; y < this.size - 1; y++) {\n        for (let x = 0; x < this.size - 1; x++) {\n          const color = this.modules[y][x];\n          if (color == this.modules[y][x + 1] && color == this.modules[y + 1][x] && color == this.modules[y + 1][x + 1])\n            result += _QrCode.PENALTY_N2;\n        }\n      }\n      let dark = 0;\n      for (const row of this.modules)\n        dark = row.reduce((sum, color) => sum + (color ? 1 : 0), dark);\n      const total = this.size * this.size;\n      const k = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;\n      assert(0 <= k && k <= 9);\n      result += k * _QrCode.PENALTY_N4;\n      assert(0 <= result && result <= 2568888);\n      return result;\n    }\n    getAlignmentPatternPositions() {\n      if (this.version == 1)\n        return [];\n      else {\n        const numAlign = Math.floor(this.version / 7) + 2;\n        const step = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2;\n        let result = [6];\n        for (let pos = this.size - 7; result.length < numAlign; pos -= step)\n          result.splice(1, 0, pos);\n        return result;\n      }\n    }\n    static getNumRawDataModules(ver) {\n      if (ver < _QrCode.MIN_VERSION || ver > _QrCode.MAX_VERSION)\n        throw new RangeError(\"Version number out of range\");\n      let result = (16 * ver + 128) * ver + 64;\n      if (ver >= 2) {\n        const numAlign = Math.floor(ver / 7) + 2;\n        result -= (25 * numAlign - 10) * numAlign - 55;\n        if (ver >= 7)\n          result -= 36;\n      }\n      assert(208 <= result && result <= 29648);\n      return result;\n    }\n    static getNumDataCodewords(ver, ecl) {\n      return Math.floor(_QrCode.getNumRawDataModules(ver) / 8) - _QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] * _QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n    }\n    static reedSolomonComputeDivisor(degree) {\n      if (degree < 1 || degree > 255)\n        throw new RangeError(\"Degree out of range\");\n      let result = [];\n      for (let i = 0; i < degree - 1; i++)\n        result.push(0);\n      result.push(1);\n      let root = 1;\n      for (let i = 0; i < degree; i++) {\n        for (let j = 0; j < result.length; j++) {\n          result[j] = _QrCode.reedSolomonMultiply(result[j], root);\n          if (j + 1 < result.length)\n            result[j] ^= result[j + 1];\n        }\n        root = _QrCode.reedSolomonMultiply(root, 2);\n      }\n      return result;\n    }\n    static reedSolomonComputeRemainder(data, divisor) {\n      let result = divisor.map((_) => 0);\n      for (const b of data) {\n        const factor = b ^ result.shift();\n        result.push(0);\n        divisor.forEach((coef, i) => result[i] ^= _QrCode.reedSolomonMultiply(coef, factor));\n      }\n      return result;\n    }\n    static reedSolomonMultiply(x, y) {\n      if (x >>> 8 != 0 || y >>> 8 != 0)\n        throw new RangeError(\"Byte out of range\");\n      let z = 0;\n      for (let i = 7; i >= 0; i--) {\n        z = z << 1 ^ (z >>> 7) * 285;\n        z ^= (y >>> i & 1) * x;\n      }\n      assert(z >>> 8 == 0);\n      return z;\n    }\n    finderPenaltyCountPatterns(runHistory) {\n      const n = runHistory[1];\n      assert(n <= this.size * 3);\n      const core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;\n      return (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0) + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);\n    }\n    finderPenaltyTerminateAndCount(currentRunColor, currentRunLength, runHistory) {\n      if (currentRunColor) {\n        this.finderPenaltyAddHistory(currentRunLength, runHistory);\n        currentRunLength = 0;\n      }\n      currentRunLength += this.size;\n      this.finderPenaltyAddHistory(currentRunLength, runHistory);\n      return this.finderPenaltyCountPatterns(runHistory);\n    }\n    finderPenaltyAddHistory(currentRunLength, runHistory) {\n      if (runHistory[0] == 0)\n        currentRunLength += this.size;\n      runHistory.pop();\n      runHistory.unshift(currentRunLength);\n    }\n  };\n  let QrCode = _QrCode;\n  QrCode.MIN_VERSION = 1;\n  QrCode.MAX_VERSION = 40;\n  QrCode.PENALTY_N1 = 3;\n  QrCode.PENALTY_N2 = 3;\n  QrCode.PENALTY_N3 = 40;\n  QrCode.PENALTY_N4 = 10;\n  QrCode.ECC_CODEWORDS_PER_BLOCK = [\n    [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n    [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],\n    [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n    [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]\n  ];\n  QrCode.NUM_ERROR_CORRECTION_BLOCKS = [\n    [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],\n    [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],\n    [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],\n    [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]\n  ];\n  qrcodegen2.QrCode = QrCode;\n  function appendBits(val, len, bb) {\n    if (len < 0 || len > 31 || val >>> len != 0)\n      throw new RangeError(\"Value out of range\");\n    for (let i = len - 1; i >= 0; i--)\n      bb.push(val >>> i & 1);\n  }\n  function getBit(x, i) {\n    return (x >>> i & 1) != 0;\n  }\n  function assert(cond) {\n    if (!cond)\n      throw new Error(\"Assertion error\");\n  }\n  const _QrSegment = class {\n    constructor(mode, numChars, bitData) {\n      this.mode = mode;\n      this.numChars = numChars;\n      this.bitData = bitData;\n      if (numChars < 0)\n        throw new RangeError(\"Invalid argument\");\n      this.bitData = bitData.slice();\n    }\n    static makeBytes(data) {\n      let bb = [];\n      for (const b of data)\n        appendBits(b, 8, bb);\n      return new _QrSegment(_QrSegment.Mode.BYTE, data.length, bb);\n    }\n    static makeNumeric(digits) {\n      if (!_QrSegment.isNumeric(digits))\n        throw new RangeError(\"String contains non-numeric characters\");\n      let bb = [];\n      for (let i = 0; i < digits.length; ) {\n        const n = Math.min(digits.length - i, 3);\n        appendBits(parseInt(digits.substr(i, n), 10), n * 3 + 1, bb);\n        i += n;\n      }\n      return new _QrSegment(_QrSegment.Mode.NUMERIC, digits.length, bb);\n    }\n    static makeAlphanumeric(text) {\n      if (!_QrSegment.isAlphanumeric(text))\n        throw new RangeError(\"String contains unencodable characters in alphanumeric mode\");\n      let bb = [];\n      let i;\n      for (i = 0; i + 2 <= text.length; i += 2) {\n        let temp = _QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;\n        temp += _QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));\n        appendBits(temp, 11, bb);\n      }\n      if (i < text.length)\n        appendBits(_QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)), 6, bb);\n      return new _QrSegment(_QrSegment.Mode.ALPHANUMERIC, text.length, bb);\n    }\n    static makeSegments(text) {\n      if (text == \"\")\n        return [];\n      else if (_QrSegment.isNumeric(text))\n        return [_QrSegment.makeNumeric(text)];\n      else if (_QrSegment.isAlphanumeric(text))\n        return [_QrSegment.makeAlphanumeric(text)];\n      else\n        return [_QrSegment.makeBytes(_QrSegment.toUtf8ByteArray(text))];\n    }\n    static makeEci(assignVal) {\n      let bb = [];\n      if (assignVal < 0)\n        throw new RangeError(\"ECI assignment value out of range\");\n      else if (assignVal < 1 << 7)\n        appendBits(assignVal, 8, bb);\n      else if (assignVal < 1 << 14) {\n        appendBits(2, 2, bb);\n        appendBits(assignVal, 14, bb);\n      } else if (assignVal < 1e6) {\n        appendBits(6, 3, bb);\n        appendBits(assignVal, 21, bb);\n      } else\n        throw new RangeError(\"ECI assignment value out of range\");\n      return new _QrSegment(_QrSegment.Mode.ECI, 0, bb);\n    }\n    static isNumeric(text) {\n      return _QrSegment.NUMERIC_REGEX.test(text);\n    }\n    static isAlphanumeric(text) {\n      return _QrSegment.ALPHANUMERIC_REGEX.test(text);\n    }\n    getData() {\n      return this.bitData.slice();\n    }\n    static getTotalBits(segs, version) {\n      let result = 0;\n      for (const seg of segs) {\n        const ccbits = seg.mode.numCharCountBits(version);\n        if (seg.numChars >= 1 << ccbits)\n          return Infinity;\n        result += 4 + ccbits + seg.bitData.length;\n      }\n      return result;\n    }\n    static toUtf8ByteArray(str) {\n      str = encodeURI(str);\n      let result = [];\n      for (let i = 0; i < str.length; i++) {\n        if (str.charAt(i) != \"%\")\n          result.push(str.charCodeAt(i));\n        else {\n          result.push(parseInt(str.substr(i + 1, 2), 16));\n          i += 2;\n        }\n      }\n      return result;\n    }\n  };\n  let QrSegment = _QrSegment;\n  QrSegment.NUMERIC_REGEX = /^[0-9]*$/;\n  QrSegment.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\\/:-]*$/;\n  QrSegment.ALPHANUMERIC_CHARSET = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:\";\n  qrcodegen2.QrSegment = QrSegment;\n})(qrcodegen || (qrcodegen = {}));\n((qrcodegen2) => {\n  let QrCode;\n  ((QrCode2) => {\n    const _Ecc = class {\n      constructor(ordinal, formatBits) {\n        this.ordinal = ordinal;\n        this.formatBits = formatBits;\n      }\n    };\n    let Ecc = _Ecc;\n    Ecc.LOW = new _Ecc(0, 1);\n    Ecc.MEDIUM = new _Ecc(1, 0);\n    Ecc.QUARTILE = new _Ecc(2, 3);\n    Ecc.HIGH = new _Ecc(3, 2);\n    QrCode2.Ecc = Ecc;\n  })(QrCode = qrcodegen2.QrCode || (qrcodegen2.QrCode = {}));\n})(qrcodegen || (qrcodegen = {}));\n((qrcodegen2) => {\n  let QrSegment;\n  ((QrSegment2) => {\n    const _Mode = class {\n      constructor(modeBits, numBitsCharCount) {\n        this.modeBits = modeBits;\n        this.numBitsCharCount = numBitsCharCount;\n      }\n      numCharCountBits(ver) {\n        return this.numBitsCharCount[Math.floor((ver + 7) / 17)];\n      }\n    };\n    let Mode = _Mode;\n    Mode.NUMERIC = new _Mode(1, [10, 12, 14]);\n    Mode.ALPHANUMERIC = new _Mode(2, [9, 11, 13]);\n    Mode.BYTE = new _Mode(4, [8, 16, 16]);\n    Mode.KANJI = new _Mode(8, [8, 10, 12]);\n    Mode.ECI = new _Mode(7, [0, 0, 0]);\n    QrSegment2.Mode = Mode;\n  })(QrSegment = qrcodegen2.QrSegment || (qrcodegen2.QrSegment = {}));\n})(qrcodegen || (qrcodegen = {}));\nvar qrcodegen_default = qrcodegen;\n\n// src/index.tsx\n/**\n * @license qrcode.react\n * Copyright (c) Paul O'Shannessy\n * SPDX-License-Identifier: ISC\n */\nvar ERROR_LEVEL_MAP = {\n  L: qrcodegen_default.QrCode.Ecc.LOW,\n  M: qrcodegen_default.QrCode.Ecc.MEDIUM,\n  Q: qrcodegen_default.QrCode.Ecc.QUARTILE,\n  H: qrcodegen_default.QrCode.Ecc.HIGH\n};\nvar DEFAULT_SIZE = 128;\nvar DEFAULT_LEVEL = \"L\";\nvar DEFAULT_BGCOLOR = \"#FFFFFF\";\nvar DEFAULT_FGCOLOR = \"#000000\";\nvar DEFAULT_INCLUDEMARGIN = false;\nvar MARGIN_SIZE = 4;\nvar DEFAULT_IMG_SCALE = 0.1;\nfunction generatePath(modules, margin = 0) {\n  const ops = [];\n  modules.forEach(function(row, y) {\n    let start = null;\n    row.forEach(function(cell, x) {\n      if (!cell && start !== null) {\n        ops.push(`M${start + margin} ${y + margin}h${x - start}v1H${start + margin}z`);\n        start = null;\n        return;\n      }\n      if (x === row.length - 1) {\n        if (!cell) {\n          return;\n        }\n        if (start === null) {\n          ops.push(`M${x + margin},${y + margin} h1v1H${x + margin}z`);\n        } else {\n          ops.push(`M${start + margin},${y + margin} h${x + 1 - start}v1H${start + margin}z`);\n        }\n        return;\n      }\n      if (cell && start === null) {\n        start = x;\n      }\n    });\n  });\n  return ops.join(\"\");\n}\nfunction excavateModules(modules, excavation) {\n  return modules.slice().map((row, y) => {\n    if (y < excavation.y || y >= excavation.y + excavation.h) {\n      return row;\n    }\n    return row.map((cell, x) => {\n      if (x < excavation.x || x >= excavation.x + excavation.w) {\n        return cell;\n      }\n      return false;\n    });\n  });\n}\nfunction getImageSettings(cells, size, includeMargin, imageSettings) {\n  if (imageSettings == null) {\n    return null;\n  }\n  const margin = includeMargin ? MARGIN_SIZE : 0;\n  const numCells = cells.length + margin * 2;\n  const defaultSize = Math.floor(size * DEFAULT_IMG_SCALE);\n  const scale = numCells / size;\n  const w = (imageSettings.width || defaultSize) * scale;\n  const h = (imageSettings.height || defaultSize) * scale;\n  const x = imageSettings.x == null ? cells.length / 2 - w / 2 : imageSettings.x * scale;\n  const y = imageSettings.y == null ? cells.length / 2 - h / 2 : imageSettings.y * scale;\n  let excavation = null;\n  if (imageSettings.excavate) {\n    let floorX = Math.floor(x);\n    let floorY = Math.floor(y);\n    let ceilW = Math.ceil(w + x - floorX);\n    let ceilH = Math.ceil(h + y - floorY);\n    excavation = { x: floorX, y: floorY, w: ceilW, h: ceilH };\n  }\n  return { x, y, h, w, excavation };\n}\nvar SUPPORTS_PATH2D = function() {\n  try {\n    new Path2D().addPath(new Path2D());\n  } catch (e) {\n    return false;\n  }\n  return true;\n}();\nfunction QRCodeCanvas(props) {\n  const _a = props, {\n    value,\n    size = DEFAULT_SIZE,\n    level = DEFAULT_LEVEL,\n    bgColor = DEFAULT_BGCOLOR,\n    fgColor = DEFAULT_FGCOLOR,\n    includeMargin = DEFAULT_INCLUDEMARGIN,\n    style,\n    imageSettings\n  } = _a, otherProps = __objRest(_a, [\n    \"value\",\n    \"size\",\n    \"level\",\n    \"bgColor\",\n    \"fgColor\",\n    \"includeMargin\",\n    \"style\",\n    \"imageSettings\"\n  ]);\n  const imgSrc = imageSettings == null ? void 0 : imageSettings.src;\n  const _canvas = useRef(null);\n  const _image = useRef(null);\n  const [isImgLoaded, setIsImageLoaded] = useState(false);\n  useEffect(() => {\n    if (_canvas.current != null) {\n      const canvas = _canvas.current;\n      const ctx = canvas.getContext(\"2d\");\n      if (!ctx) {\n        return;\n      }\n      let cells = qrcodegen_default.QrCode.encodeText(value, ERROR_LEVEL_MAP[level]).getModules();\n      const margin = includeMargin ? MARGIN_SIZE : 0;\n      const numCells = cells.length + margin * 2;\n      const calculatedImageSettings = getImageSettings(cells, size, includeMargin, imageSettings);\n      const image = _image.current;\n      const haveImageToRender = calculatedImageSettings != null && image !== null && image.complete && image.naturalHeight !== 0 && image.naturalWidth !== 0;\n      if (haveImageToRender) {\n        if (calculatedImageSettings.excavation != null) {\n          cells = excavateModules(cells, calculatedImageSettings.excavation);\n        }\n      }\n      const pixelRatio = window.devicePixelRatio || 1;\n      canvas.height = canvas.width = size * pixelRatio;\n      const scale = size / numCells * pixelRatio;\n      ctx.scale(scale, scale);\n      ctx.fillStyle = bgColor;\n      ctx.fillRect(0, 0, numCells, numCells);\n      ctx.fillStyle = fgColor;\n      if (SUPPORTS_PATH2D) {\n        ctx.fill(new Path2D(generatePath(cells, margin)));\n      } else {\n        cells.forEach(function(row, rdx) {\n          row.forEach(function(cell, cdx) {\n            if (cell) {\n              ctx.fillRect(cdx + margin, rdx + margin, 1, 1);\n            }\n          });\n        });\n      }\n      if (haveImageToRender) {\n        ctx.drawImage(image, calculatedImageSettings.x + margin, calculatedImageSettings.y + margin, calculatedImageSettings.w, calculatedImageSettings.h);\n      }\n    }\n  });\n  useEffect(() => {\n    setIsImageLoaded(false);\n  }, [imgSrc]);\n  const canvasStyle = __spreadValues({ height: size, width: size }, style);\n  let img = null;\n  if (imgSrc != null) {\n    img = /* @__PURE__ */ React.createElement(\"img\", {\n      src: imgSrc,\n      key: imgSrc,\n      style: { display: \"none\" },\n      onLoad: () => {\n        setIsImageLoaded(true);\n      },\n      ref: _image\n    });\n  }\n  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(\"canvas\", __spreadValues({\n    style: canvasStyle,\n    height: size,\n    width: size,\n    ref: _canvas\n  }, otherProps)), img);\n}\nfunction QRCodeSVG(props) {\n  const _a = props, {\n    value,\n    size = DEFAULT_SIZE,\n    level = DEFAULT_LEVEL,\n    bgColor = DEFAULT_BGCOLOR,\n    fgColor = DEFAULT_FGCOLOR,\n    includeMargin = DEFAULT_INCLUDEMARGIN,\n    imageSettings\n  } = _a, otherProps = __objRest(_a, [\n    \"value\",\n    \"size\",\n    \"level\",\n    \"bgColor\",\n    \"fgColor\",\n    \"includeMargin\",\n    \"imageSettings\"\n  ]);\n  let cells = qrcodegen_default.QrCode.encodeText(value, ERROR_LEVEL_MAP[level]).getModules();\n  const margin = includeMargin ? MARGIN_SIZE : 0;\n  const numCells = cells.length + margin * 2;\n  const calculatedImageSettings = getImageSettings(cells, size, includeMargin, imageSettings);\n  let image = null;\n  if (imageSettings != null && calculatedImageSettings != null) {\n    if (calculatedImageSettings.excavation != null) {\n      cells = excavateModules(cells, calculatedImageSettings.excavation);\n    }\n    image = /* @__PURE__ */ React.createElement(\"image\", {\n      xlinkHref: imageSettings.src,\n      height: calculatedImageSettings.h,\n      width: calculatedImageSettings.w,\n      x: calculatedImageSettings.x + margin,\n      y: calculatedImageSettings.y + margin,\n      preserveAspectRatio: \"none\"\n    });\n  }\n  const fgPath = generatePath(cells, margin);\n  return /* @__PURE__ */ React.createElement(\"svg\", __spreadValues({\n    height: size,\n    width: size,\n    viewBox: `0 0 ${numCells} ${numCells}`\n  }, otherProps), /* @__PURE__ */ React.createElement(\"path\", {\n    fill: bgColor,\n    d: `M0,0 h${numCells}v${numCells}H0z`,\n    shapeRendering: \"crispEdges\"\n  }), /* @__PURE__ */ React.createElement(\"path\", {\n    fill: fgColor,\n    d: fgPath,\n    shapeRendering: \"crispEdges\"\n  }), image);\n}\nvar QRCode = (props) => {\n  const _a = props, { renderAs } = _a, otherProps = __objRest(_a, [\"renderAs\"]);\n  if (renderAs === \"svg\") {\n    return /* @__PURE__ */ React.createElement(QRCodeSVG, __spreadValues({}, otherProps));\n  }\n  return /* @__PURE__ */ React.createElement(QRCodeCanvas, __spreadValues({}, otherProps));\n};\nexport {\n  QRCodeCanvas,\n  QRCodeSVG,\n  QRCode as default\n};\n"],"mappings":";;;;AAAA,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,I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